package dominio;

import javax.persistence.Embeddable;

@Embeddable
public class Convenio {

	private float valorHora;
	private int horas;

	public float getValorHora() {
		return valorHora;
	}

	public void setValorHora(float valorHora) {
		this.valorHora = valorHora;
	}

	public int getHoras() {
		return horas;
	}

	public void setHoras(int horas) {
		this.horas = horas;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + horas;
		result = prime * result + Float.floatToIntBits(valorHora);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Convenio other = (Convenio) obj;
		if (horas != other.horas)
			return false;
		if (Float.floatToIntBits(valorHora) != Float
				.floatToIntBits(other.valorHora))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Convenio [valorHora=" + valorHora + ", horas=" + horas + "]";
	}

}
